package com.ruoyi.net.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.domain.BusiL2VpnNodePort;
import com.ruoyi.net.domain.BusiL2VpnNodePortListVo;
import com.ruoyi.net.mapper.BusiL2VpnNodePortMapper;
import com.ruoyi.net.service.IBusiL2VpnNodePortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务-L2 VPN配置-节点属性-业务接入接口参数Service业务层处理
 * 
 * @author net
 * @date 2024-12-14
 */
@Service
public class BusiL2VpnNodePortServiceImpl implements IBusiL2VpnNodePortService 
{
    @Autowired
    private BusiL2VpnNodePortMapper busiL2VpnNodePortMapper;

    /**
     * 查询业务-L2 VPN配置-节点属性-业务接入接口参数
     * 
     * @param id 业务-L2 VPN配置-节点属性-业务接入接口参数主键
     * @return 业务-L2 VPN配置-节点属性-业务接入接口参数
     */
    @Override
    public BusiL2VpnNodePort selectBusiL2VpnNodePortById(String id)
    {
        return busiL2VpnNodePortMapper.selectBusiL2VpnNodePortById(id);
    }

    /**
     * 查询业务-L2 VPN配置-节点属性-业务接入接口参数列表
     * 
     * @param busiL2VpnNodePort 业务-L2 VPN配置-节点属性-业务接入接口参数
     * @return 业务-L2 VPN配置-节点属性-业务接入接口参数
     */
    @Override
    public List<BusiL2VpnNodePortListVo> selectBusiL2VpnNodePortList(BusiL2VpnNodePort busiL2VpnNodePort)
    {
        return busiL2VpnNodePortMapper.selectBusiL2VpnNodePortList(busiL2VpnNodePort);
    }

    /**
     * 新增业务-L2 VPN配置-节点属性-业务接入接口参数
     * 
     * @param busiL2VpnNodePort 业务-L2 VPN配置-节点属性-业务接入接口参数
     * @return 结果
     */
    @Override
    public int insertBusiL2VpnNodePort(BusiL2VpnNodePort busiL2VpnNodePort)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiL2VpnNodePort.getId())) {
            busiL2VpnNodePort.setId(uuid);
        }
        busiL2VpnNodePort.setCreateBy(SecurityUtils.getUsername());
        busiL2VpnNodePort.setCreateTime(DateUtils.getNowDate());
        busiL2VpnNodePort.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnNodePort.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnNodePortMapper.insertBusiL2VpnNodePort(busiL2VpnNodePort);
    }

    /**
     * 修改业务-L2 VPN配置-节点属性-业务接入接口参数
     * 
     * @param busiL2VpnNodePort 业务-L2 VPN配置-节点属性-业务接入接口参数
     * @return 结果
     */
    @Override
    public int updateBusiL2VpnNodePort(BusiL2VpnNodePort busiL2VpnNodePort)
    {
        busiL2VpnNodePort.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnNodePort.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnNodePortMapper.updateBusiL2VpnNodePort(busiL2VpnNodePort);
    }

    /**
     * 批量删除业务-L2 VPN配置-节点属性-业务接入接口参数
     * 
     * @param ids 需要删除的业务-L2 VPN配置-节点属性-业务接入接口参数主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnNodePortByIds(String[] ids)
    {
        return busiL2VpnNodePortMapper.deleteBusiL2VpnNodePortByIds(ids);
    }

    /**
     * 删除业务-L2 VPN配置-节点属性-业务接入接口参数信息
     * 
     * @param id 业务-L2 VPN配置-节点属性-业务接入接口参数主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnNodePortById(String id)
    {
        return busiL2VpnNodePortMapper.deleteBusiL2VpnNodePortById(id);
    }
}
